package com.wolf.util;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author sdyang
 * @create 2017-11-12 10:25
 **/
public class DateUtil {

    public final static String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss";
    public final static String YYYY_MM_DD = "yyyy-MM-dd";

    /**
     *
     *
     * @param date
     * @return
     */
    public static String toString(Date date) {
        SimpleDateFormat format = new SimpleDateFormat(YYYY_MM_DD_HH_MM_SS);
        return format.format(date);
    }

    /**
     * 当前时间
     *
     * @return
     */
    public static String getNow() {
        SimpleDateFormat format = new SimpleDateFormat(YYYY_MM_DD_HH_MM_SS);
        Date date = new Date();
        return format.format(date);
    }


}
